<template>
    <div style="padding: 15px">
        <el-table
            v-loading="loading"
            :header-cell-style="headerCellStyle"
            :data="tableData"
            size="small"
            max-height="350px"
        >
            <el-table-column
                prop="skinPackageName"
                label="当前版本名称"
                show-overflow-tooltip
            ></el-table-column>
            <el-table-column
                prop="skinPackageCode"
                label="当前版本号"
                show-overflow-tooltip
            ></el-table-column>
            <el-table-column
                prop="specSkinPackageName"
                label="指定版本名称"
                show-overflow-tooltip
            ></el-table-column>
            <el-table-column
                prop="specSkinPackageCode"
                label="指定版本号"
                show-overflow-tooltip
            ></el-table-column>
            <el-table-column
                prop="terminalTypeName"
                label="设备类型"
                show-overflow-tooltip
            ></el-table-column>
        </el-table>
    </div>
</template>

<script>
export default {
    props: {
        value: Boolean,
        currRow: Object
    },
    data () {
        return {
            currentPage: 1,
            pageSize: 10,
            totalNum: 0,
            loading: false,
            tableData: [],
            showValue: false,
            deviceTypeList: [],
            form: {
                terminalType: ''
            }
        }
    },
    watch: {
        value (val) {
            this.showValue = val
        },
        showValue (val) {
            this.$emit('update:value', val)
        }
    },
    created () {
        this.getList()
    },
    methods: {
        async getList () {
            this.loading = true
            const res = await this.$http.get(this.$store.state.IP + `/system/company/getCompanySkinVersion?companyCode=${this.currRow.companyCode}`, {
            })
            let response = res.data
            if (response.ret === '0') {
                this.loading = false
                this.tableData = response.data
            } else {
                this.loading = false
            }
        },
        // 清空数据
        clearData () {
            this.showValue = false
        }
    }
}
</script>
<style lang="stylus" rel="stylesheet/stylus" scoped>
.item
    width: 110px

.right
    text-align: right
</style>